/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#include "../Types.h"

#include "typestack.h"

 
static type_item * free_list = 0;
 
 
extern void type_list_init( type_list * list );

type_item * type_item_alloc()
{
	type_item * item;
	/* FIXME requires lock for multithreading. */
	
	if ( free_list == 0 )
	{
		item = (type_item *) type_malloc( sizeof( type_item ) );
		item->next = 0;
		return item;
	}
	
	item = free_list;
	free_list = item->next;

	item->data.u64 = 0;
	item->next = 0;
	return item;
}

void type_item_free( type_item * item )
{
	/* FIXME requires lock for multithreading. */
	
	item->next = free_list;
	free_list = item;
}

